/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.api;

import java.io.IOException;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodegenerators.main.MainGenerator;
import pl.edu.amu.wmi.kino.visualjavafx.model.objects.Application;


/**
 * This class is api used to generate code from the model
 * @author Admin
 */
public class JavaFXCodeGenerator {
    /**
     * This method generates a String containing all code generated from given Application
     * class + extra code like imports and such. This code is supposed to be javafx runnable :)
     * @param app - application class from model with all of the children etc.
     * @return returns a String that is to be put in the vfx file ant than compiled
     * @throws java.io.IOException when files with dummyCode are missing
     * will be throwing unsupportedOperationException in the final version when there will
     * be no registered generator to generate an object
     */
    synchronized public static String generateCode(Application app) throws IOException{
        return MainGenerator.generateAll(app);
    }
}
